/*******************************************************************
 *
 * Copyright (C), 2021-2022, LS, All rights reserved.
 *
 * Author      : 
 * Create Time : 2021-12-22
 * Version     : v0.1
 * Description : 
 *******************************************************************/
 
#ifndef _LS_BLE_FILE_TEXT_API_H_
#define _LS_BLE_FILE_TEXT_API_H_

/*----------------------------Head file----------------------------*/
#include "stdint.h"
#include "ls_ble_file_api.h"
#include "ls_ble_sdk_config.h"

/*----------------------------macro file---------------------------*/
#define TEXT_CHAR_MAX_NUM       6

/*----------------------------type define--------------------------*/
#pragma pack(1)

typedef enum {
    TXT_INFO_SUCCESS = 0,
    TXT_INFO_TYPE_ERROR,
    TXT_INFO_SIZE_ERROR,
    TXT_INFO_DEV_BUSY,
} text_rsp_err_t;

typedef struct {
    uint32_t file_len;
    uint16_t file_crc;
    uint8_t scene_type;
    uint8_t font_width;
    uint8_t font_height;
    uint16_t char_num;
} text_head_info_t;

typedef struct {
    text_head_info_t head;
    uint16_t unicode[CHAR_NUM_MAX_SIZE];
} text_info_t;

#pragma pack()

/*----------------------------var define---------------------------*/

/*-------------------------func declaration------------------------*/
extern bool file_text_image_check_crc_valid(void);
extern uint8_t ls_ble_file_set_text_info(uint8_t *payload, uint16_t payload_len, file_trans_t* file_trans);
extern void ls_ble_file_text_rx_raw_data_handle(uint8_t *file_data, uint16_t data_len, file_trans_t* file_trans);
extern uint8_t ls_ble_file_text_trans_done_handle(file_trans_t* file_trans);

/*-----------------------------------------------------------------*/

#endif
